<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="layout.html" />
  <xi:include href="macros.html" />
  <head>
    <title>MailArchive - $message.subject</title>
    <script type="text/javascript">
      jQuery(document).ready(function($) {
        $("#content").find("h1,h2,h3,h4,h5,h6").addAnchor("${_('Link to this section')}");
      });
    </script>
  </head>

  <body>
    <div id="content" class="mailarchive">


 <form py:if="len(reflist) >=2" id="prefs" method="get" action="">

  <div>Wiki/Text切替</div>
    <ul>
    <li><label> <input type="radio" name="wikimode" value="on"  checked="checked" /> wiki表示</label>
    </li>
    <li><label> <input type="radio" name="wikimode" value="off" /> text表示</label>
    </li>
    </ul>
  <div class="buttons">
   <input type="submit" name="update" value="更新"/>
  </div>

  <label >関連するメール:</label>
  <ul>
  <py:for each="refmail in reflist">
    <li>
      <py:choose test="refmail.href!=''">
        <py:when test="True">
          <a class="subject" href="$refmail.href" alt="$refmail.subject_alt">$refmail.subject</a>
        </py:when>
        <py:otherwise>
          <strong alt="$refmail.subject_alt">$refmail.subject</strong>
        </py:otherwise>
      </py:choose>
    <span class="prefs_from" >$refmail.fromname</span></li>
  </py:for>
  </ul>
 </form>

  <h2>$message.subject</h2>
  <ul>
    <li>From:<a class="mail-link" href="mailto:$message.fromaddr"><span class="icon"/>$message.fromname</a></li>
    <li>Date:$message.senddate</li>
  </ul>
  
  <fieldset>
    <legend>関連チケット</legend>
    <form id="new_ticket" method="post" action="${req.href('newticket')}">
      <div py:if="len(related_tickets) > 0">
        <ul>
          <py:for each="ticket in related_tickets">
            <li><a href="${req.href('ticket') + '/%s' % ticket.id}">#${ticket.id} ${ticket.summary}</a><br/></li>
          </py:for>
        </ul>
      </div>
      <div class="buttons">
        <input type="hidden" name="preview" value="preview"/>
        <input type="hidden" name="field_summary" value="$message.subject"/>
        <input type="hidden" name="field_reporter" value="$message.fromaddr"/>
        <input type="hidden" name="field_mail_id" value="$message.id"/>
        <textarea style="display:none;" name="field_description">{{{
$message.plain_body
}}}</textarea>
        <input type="submit" name="new_ticket_from_mail" value="このメールの内容をチケットに登録"/>
      </div>
    </form>
  </fieldset>

  <div class="mailarcpage searchable">$message.page_html</div>

  ${list_of_attachments(attachments,True)}

</div>

  </body>
</html>


